<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<title>留言板 -- Powered by CentIMS {$core_version}</title>
		<link href="{'bootstrap/css/bootstrap.css'|shared}" rel="stylesheet"/>
		<link href="{'bootstrap/css/bootstrap-responsive.css'|shared}" rel="stylesheet"/>
		<link href="{'common.css'|shared}" rel="stylesheet"/>
	</head>
	<body>
		<div class="workspace">
			<ul class="nav nav-tabs">
				<li>&nbsp;&nbsp;</li>
				<li class="active"><a href="#"><i class="icon-comment"></i>客户留言</a></li>
			</ul>
			<div class="tabbable tabs-left">
				<ul class="nav nav-tabs" style="min-height:350px;">					
					<li class="{if $status == 'new'}active{/if}">
						<a href="."><i class="icon-comment"></i>最新留言({$new_total})</a>
					</li>
					<li class="{if $status == 'pass'}active{/if}">
						<a href="./?status=pass" class="tgre"><i class="icon-thumbs-up"></i>已回复({$pass_total})</a>
					</li>
					<li class="{if $status == 'spam'}active{/if}">
						<a href="./?status=spam" class="torg"><i class="icon-volume-off"></i>垃圾留言({$spam_total})</a>
					</li>
					<li class="{if $status == 'deleted'}active{/if}">
						<a href="./?status=deleted" class="tred"><i class="icon-trash"></i>回收站({$deleted_total})</a>
					</li>
				</ul>
				<div class="tab-content" style="padding-bottom:200px;">
					
					{if $page_tip_info}
				    <div class="alert alert-info">
				        <button class="close" data-dismiss="alert">×</button>
				        {$page_tip_info}
			      	</div>
			      	{/if}		
					
					<div class="pull-right txt-ar">
						<form class="form-inline" method="get" action="./?status={$status}">
							<input type="text" class="input-small" name="cname" value="{$cname}" placeholder="客户姓名"/>					    
						    <input type="text" class="input-medium" name="uname" value="{$uname}" placeholder="回复者"/>				    	    
						    <button type="submit" class="btn"><i class="icon-search"></i>搜索</button>
					    </form>
				    </div>				    		    
				    <br class="clear"/>	
				    	
				    <table id="asks-list" class="table table-striped table-bordered table-condensed">
						<thead>
							<tr>
								<th class="col_chk"><input type="checkbox"/></th>								
								<th style="width:48%">{'留言'|sorth:ask_time:$curl}</th>
								<th class="wa">{'回复'|sorth:anwer_time:$curl}</th>
							</tr>
						</thead>
						<tbody>
							{foreach from=$items item=item}
							<tr>
								<td class="col_chk"><input type="checkbox" value="{$item.ask_id}"/></td>								
								<td class="author-td has-row-actions">
									<div class="author mgb10">
										<p><strong>{$item.asker_name}@{$item.ask_ip}</strong><span>于{$item.ask_time|date_format:'Y-m-d H:i'}</span>.</p>
										
										{if $item.asker_email}
											<span class="label">邮箱:<a href="mailto:{$item.asker_email}" title="{$item.asker_email}">{$item.asker_email|truncate:30}</a></span>
										{/if}
										{if $item.asker_phone}
											<span class="label label-info">电话:{$item.asker_phone}</span>
										{/if}
										{if $item.asker_qq}
											<span class="label label-info">QQ:{$item.asker_qq}</span>
										{/if}
									</div>															
									<p>{$item.ask_content|nl2br}</p>
									<div class="row-actions">{'get_ask_operations'|fire:$item}</div>				
								</td>
								<td>									
									{if $item.anwer_name}
									<div class="sbt-info mgb10">
										<strong>{$item.anwer_name}</strong><span>于{$item.anwer_time|date_format:'Y-m-d H:i'}做出回复.</span>
									</div>
									<p>{$item.anw_content|nl2br}</p>
									{else}
										<a class="reply-ask" href="{''|here}?Ctlr=ReplyAsk&ask_id={$item.ask_id}">立即回复</a>
									{/if}									
								</td>																
							</tr>
							{foreachelse}
							<tr>
								<td colspan="3" class="txt-ac">无留言</td>						
							</tr>
							{/foreach}
						</tbody>
					</table>
					
					<div class="form-horizontal">
						<div class="control-group pull-left">
							<div class="btn-group">
								<button class="btn btn-selectall"><i class="icon-check"></i>全选/反选</button>
					          	<a class="btn dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
					          	<ul class="dropdown-menu">
					            	{'get_ask_bench_options'|fire:$status}
					          	</ul>
					    	</div>
						</div>
						<div class="pagination pull-right">
							{$curl|paging:$totalCount:$limit:'start'}
					    </div>
				    </div>
				    <br class="clear"/>					
					
				</div>
			</div>				
		</div>
		<script type="text/javascript" src="{'jquery-1.7.1.js'|jquery}"></script>
		<script type="text/javascript" src="{'bootstrap/bootstrap.js'|shared}"></script>
		<script type="text/javascript" src="{'common.js'|shared}"></script>		
		<script type="text/javascript" src="{'ask.js'|here}"></script>
	</body>
</html>